class CreateCampaigns < ActiveRecord::Migration
  def self.up
    create_table :campaigns do |t|
      #basic properties
      t.string :name
      t.text :description
      t.integer :owner_id #the campaign owner
      
      #the page associated with the campaign
      t.integer :campaign_instructions_page_id
      t.integer :campaign_rules_page_id
      t.integer :campaign_privacy_page_id
      
      
      #images
      
      t.string :campaign_image_file_name
      t.string :campaign_image_content_type
      t.integer :campaign_image_file_size
      t.datetime :campaign_image_file_updated_at
      
      
      t.string :background_image_file_name
      t.string :background_image_content_type
      t.integer :background_image_file_size
      t.datetime :background_image_file_updated_at
      
      t.string :header_image_file_name
      t.string :header_image_content_type
      t.integer :header_image_file_size
      t.datetime :header_image_file_updated_at
      
      #Global Share buttons content
      t.string :share_title
      t.string :share_description
      t.string :share_url
      
      t.string :share_image_file_name
      t.string :share_image_content_type
      t.integer :share_image_file_size
      t.datetime :share_image_file_updated_at
      
      #is this the default campaign?
      t.boolean :is_default, :default=>false
      
      #requires user email?
      t.boolean :is_email_required
      
      #start date and duration of campaign. If default then is ignored
      t.datetime :start_date
      t.datetime :end_date
      t.integer :winner_id #user id of the winner
      
      #a single line descritpion of the prize
      t.string :prize
      
      #points per action in the site
      t.integer :points_invite_friends
      t.integer :points_submit_content
      t.integer :points_comment_content
      t.integer :points_vote_content
      
      #invitation messages
      t.string :invitation_type
      t.string :invitation_message
      t.string :invitation_content
      t.string :invitation_action_message
      t.string :invitation_land_page_url
      
      #publish user stream messages
      t.string :publish_wall_action_link1_text
      t.string :publish_wall_action_link1_url
      t.string :publish_wall_action_link2_text
      t.string :publish_wall_action_link2_url
      t.string :publish_wall_action_link3_text
      t.string :publish_wall_action_link3_url
      t.string :publish_wall_action_link4_text
      t.string :publish_wall_action_link4_url
      t.string :publish_wall_action_link5_text
      t.string :publish_wall_action_link5_url
      t.string :publish_wall_user_message
      t.string :publish_wall_caption
      t.string :publish_wall_user_message_prompt
      t.boolean :publish_wall_auto_publish
      
      #Social Networks
      t.string :twitter_account_url
      t.string :linkedin_account_url
      t.string :youtube_account_url
      t.string :facebook_account_url
      
      t.timestamps
    end
  end
  
  def self.down
    drop_table :campaigns
  end
end
